/*
 * Copyright (c) 2024. hallele, Inc All rights reserved.
 */

package cn.hallele.ms.usercenter.integrartion.action.user;

import cn.hallele.mc.sdk.filecenter.feign.FileFeign;
import cn.hallele.mc.sdk.usercenter.feign.UserFeign;
import cn.hallele.ms.infrastructure.util.OutGoingUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 文件服务
 *
 * @author anle5
 * @since 2024/10/5 14:42
 */
@Slf4j
@Service
public class UserIntegrationService {
    @Autowired
    private FileFeign fileFeign;

    @Autowired
    private UserFeign userFeign;

    /**
     * 获取头像url地址
     *
     * @param id 文件id
     * @return url
     */
    public String getHeaderUrl(long id) {
        // 使用默认过期值
        return OutGoingUtil.getData(fileFeign.getUrlWithExpires(id, -1));
    }
}
